package gold.digger;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * Created by fanzhenyu02 on 2020/6/27.
 * common problem solver template.
 */
public class LC1646 {
    public long startExecuteTime = System.currentTimeMillis();


    class Solution {
        public int getMaximumGenerated(int n) {
            if (n == 0) {
                return 0;
            }
            int[] nums = new int[n + 1];
            nums[1] = 1;
            for (int i = 2; i <= n; ++i) {
                nums[i] = nums[i / 2] + i % 2 * nums[i / 2 + 1];
            }
            return Arrays.stream(nums).max().getAsInt();
        }
    }

    public void run() {
        Solution solution = new Solution();
        List<Integer> list = new ArrayList<>();
        System.out.println(solution.toString());
    }

    public static void main(String[] args) throws Exception {
        LC1646 an = new LC1646();
        an.run();

        System.out.println("\ncurrent solution total execute time: " + (System.currentTimeMillis() - an.startExecuteTime) + " ms.");
    }
}
